package com.jiandian.dao;

import com.jiandian.entity.SignLog;
import com.jiandian.page.PageInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 签到记录 Mapper
 *
 * @author houqi Fu
 * @date 2018/12/15
 */
@Component
@Mapper
public interface SignLogMapper {
    SignLog selectByPrimaryKey(Long id);

    List<SignLog> selectAll(PageInfo pageInfo);

    int selectCount(PageInfo pageInfo);

    List<SignLog> batchQueryByIds(List<Long> ids);

    int updateByPrimaryKey(SignLog record);

    int insert(SignLog record);

    int batchInsert(List<SignLog> list);

    int batchDeleteById(List<Long> ids);

    int deleteByPrimaryKey(Long id);

    List<SignLog> selectByUserId(@Param("userId")int userId);

    /**
     * 获取签到的最后一天
     * @param userId
     * @return
     */
    SignLog getLastSignDay(@Param("userId") int userId);

}
